<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
 <TITLE>The VFLib Graph Matching Library, version 2.0: VFLib class reference : Class StreamARGLoader&lt;Node,Edge&gt;</TITLE>
 <LINK HREF="vflib-19.html" REL=next>
 <LINK HREF="vflib-17.html" REL=previous>
 <LINK HREF="vflib.html#toc4" REL=contents>
</HEAD>
<BODY>
<A HREF="vflib-19.html">Next</A>
<A HREF="vflib-17.html">Previous</A>
<A HREF="vflib.html#toc4">Contents</A>
<HR>
<H2>4.6 Class <CODE>StreamARGLoader&lt;Node,Edge&gt;</CODE></H2>

<P><B>Defined in:</B>  argloader.h
<P><B>Extends:</B> ARGEdit
<P><B>Overview:</B>
This class allows to read (or write) an attributed graph from a text stream.
The class relies on the stream insertion/extraction operators
(<CODE>&lt;lt;</CODE> and <CODE>&gt;&gt;</CODE>) to perform the
input/output operations on the attributes.
<P>The class parameters (<CODE>Node</CODE> and <CODE>Edge</CODE>) are the types of
the node/edge attributes, which are stored internally through
pointers. The attributes can be heap allocated, or a more
efficient allocation strategy can be implemented by means of
an Allocator object.
<P><B>File format</B>
<P>On the first line there must be the number of nodes;
subsequent lines will contain the node attributes, one node per
line, preceded by the node id; node ids must be in the range from
0 to the number of nodes - 1.
Then, for each node there is the number of edges coming out of
the node, followed by a line for each edge containing the
ids of the edge ends and the edge attribute.
Blank lines, and lines starting with #, are ignored.
An example file, where both node and edge attributes are ints,
could be the following:
<HR>
<PRE>
     # Number of nodes
     3
     # Node attributes
     0 27
     1 42
     2 13
           
     # Edges coming out of node 0
     2
     0 1  24
     0 2  73
 
     # Edges coming out of node 1
     1
     1 3  66
 
     # Edges coming out of node 2
     0      
</PRE>
<HR>
<P>
<P>
<P>
<HR>
<A HREF="vflib-19.html">Next</A>
<A HREF="vflib-17.html">Previous</A>
<A HREF="vflib.html#toc4">Contents</A>
</BODY>
</HTML>
